Trivial leak test in xcsv fixed.
authorrobertl <robertl>
Thu, 19 Oct 2006 14:59:13 +0000 (14:59 +0000)
committerrobertl <robertl>
Thu, 19 Oct 2006 14:59:13 +0000 (14:59 +0000)
xcsv.c

diff --git a/xcsv.c b/xcsv.c
index b6a9d0220eee677d1c4400d184a321fd3b330d2c..6c246c4c564c982cca12bc4c4e3aa2224ddc151a 100644 (file)
--- a/xcsv.c
+++ b/xcsv.c
@@ -219,7 +219,9 @@ xcsv_parse_style_line(const char *sbuff)
 
                /* field delimiters are always bad characters */
                if (0 == strcmp(p, "\\w")) {
-                       xstrappend(xcsv_file.badchars, " \n\r");
+                       char *s = xstrappend(xcsv_file.badchars, " \n\r");
+                       if (xcsv_file.badchars) xfree(xcsv_file.badchars);
+                       xcsv_file.badchars = s;
                } else {
                        xcsv_file.badchars = xstrappend(xcsv_file.badchars, p);
                }